Skip to content

rs: free the block pointer arrays - #233

Open
Lotion-3 wants to merge 1 commit into
XTXMarkets:mainfrom
Lotion-3:rs-free-pointer-arrays
Open

Lotion-3 wants to merge 1 commit into
XTXMarkets:mainfrom
Lotion-3:rs-free-pointer-arrays

Conversation

@Lotion-3

Copy link
Copy Markdown

ComputeParityInto and RecoverInto C.malloc the arrays of block pointers they pass to the C code, but never free them, so each call leaks a few hundred bytes. The client computes parity once per stripe it writes, so long-running clients grow with the amount of data written.

Calling both 2 million times with (10,4) parity grows RSS by about 470 MB on main; with this change it stays at 5.7 MB. This frees the arrays with defer C.free, as other cgo code in the repo does.

ComputeParityInto and RecoverInto malloc an array of block pointers to
pass to the C code, and never free it, so every call leaks 8 bytes per
block plus the allocation overhead. The client computes parity once per
stripe it writes, and recovers once per failed block it reads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant